package yl.hs.bmipfull.utils.datastate;

import yl.hs.bmipfull.utils.CK;

/*
 * ActiveDeviceType 激活平台类型
 * @category
 * @author 谢景广
 * @date 2022-05-24
 */
public enum ActiveDeviceType {
    /**
     * ERP PC端
     */
    ERPPC(0),
    /**
     * ERP 手机App
     */
    ERPMobile(1),
    /**
     * 工地端
     */
    Construction(2),
    /**
     * 司机端
     */
    Driver(3),
    /**
     * 供应商端
     */
    Supplier(4),
    /**
     * 经销商端
     */
    Dealer(5);
    public int dataCode;
    ActiveDeviceType(int code){
        this.dataCode = code;
    }
    public static String getTypeKey(ActiveDeviceType type){
        String key = CK.Active_Data;
        switch (type){
            case ERPPC -> {key= CK.Active_Data;}
            case ERPMobile -> {key=CK.Active_Mobile_Data;}
            case Construction -> {key = CK.Active_Construction_Data;}
            case Driver -> {key=CK.Active_Driver_Data;}
            case Supplier -> {key=CK.Active_Supplier_Data;}
            case Dealer -> {key=CK.Active_Dealer_Data;}
        }
        return key;
    }
    public static ActiveDeviceType getType(int type){
        var adType = ActiveDeviceType.ERPPC;
        switch (type){
            case 0 -> {adType= ActiveDeviceType.ERPPC;}
            case 1 -> {adType=ActiveDeviceType.ERPMobile;}
            case 2 -> {adType = ActiveDeviceType.Construction;}
            case 3 -> {adType=ActiveDeviceType.Driver;}
            case 4 -> {adType=ActiveDeviceType.Supplier;}
            case 5 -> {adType=ActiveDeviceType.Dealer;}
        }
        return adType;
    }
}
